<% if logged_in? %>
  <%= "welcome #{current_user.login}" %>
  <%= link_to 'logout', {:controller => 'sessions', :action => 'destroy'}, :method => :delete %> |
<% else %>
  <% store_location %>
  <%= link_to 'login', :controller => 'sessions', :action => 'new' %>
<% end %>